#define _CRT_SECURE_NO_WARNINGS 1	
#include <stdio.h>

void print(int arr[], int sz)
{
	int i = 0;
	for (i = 0;i < sz;i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}

int my_funtion1(int arr[],int val,int sz)
{
	int size = sz;
	int i = 0;
	for (i = 0;i < sz;i++)
	{
	agin:
		if (arr[i] == val)
		{
			int j = 0;
			for (j = i;j <size;j++)
			{
				arr[j] = arr[j + 1];
			}
			size--;
		}
		if (arr[i] == val)
			goto agin;

	}
	return size;
}
//1
int my_funtion2(int* arr, int val, int sz)
{
	int* dest = arr;
	int* src = dest;
	while (src)
	{
		if (*src != val)
		{
			*(++dest) = *src;
			src++;
			continue;
		}
		else
		{
			while (*src != val && src)
			{
				*(++dest) = *src;
				src++;
			}
		}

	}
	return dest - arr;

}
//
//int my_funtion2(int arr[],int val, int sz)
//{
//	int dest = 0;
//	
//}



int main()
{
	int arr[] = { 1,3,3,4};
	int sz = sizeof(arr) / sizeof(arr[0]);
	int val = 0;
	scanf("%d", &val);
	int ret=my_funtion2(arr, val,sz);
	printf("%d ", ret);
	return 0;
}
